package com.wbp.cms.core.project.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.wbp.cms.client.project.domain.ProjectDO;
import com.wbp.cms.client.project.query.ProjectQuery;
import com.wbp.cms.core.dao.BaseDao;


/**
 * @Description:
 * @Department:
 * @author andy.lhc
 * @date 2016年3月9日 下午3:06:25
 */
@Repository("projectDAO")
public class ProjectDAO extends BaseDao {

   public Long  insert(ProjectDO  projectDO){
       super.insert("ProjectMapper.insert", projectDO) ;
       return projectDO.getId() ;
   }
   
   public int  update(ProjectDO  projectDO){
     return  super.update("ProjectMapper.update", projectDO) ;
   }
   
   public ProjectDO  load(Long  projectId){
     Object  obj =  super.selectOneObject("ProjectMapper.load", projectId)  ;
     return  obj ==null ? null : (ProjectDO)obj ;
   }
   
   public List<ProjectDO>  query(ProjectQuery  projectQuery){
      return  super.selectList("ProjectMapper.query", projectQuery) ;
   }
   
   public Integer  queryCount(ProjectQuery  projectQuery){
     Object  obj =  super.selectOneObject("ProjectMapper.queryCount", projectQuery)  ; 
     return  obj == null ? 0 : (Integer)obj ;
   }
   
   public Integer queryChildenCount(ProjectQuery  projectQuery){
     Object  obj =  super.selectOneObject("ProjectMapper.queryChildenCount", projectQuery)  ; 
     return  obj == null ? 0 : (Integer)obj ;
   }
   
   public List<ProjectDO>  queryChilden(ProjectQuery  projectQuery){
     return  super.selectList("ProjectMapper.queryChilden", projectQuery) ;
  }
   
}
